package com.base.action;

import com.base.bean.Goodsman;
import com.base.service.GoodsmanService;
import com.common.util.PagerModel;
import com.core.ssh2.AbstractActionSupport;

public class GoodsmanManagerAction extends AbstractActionSupport {
	private static final long serialVersionUID = 6708357316746974506L;

	private GoodsmanService goodsmanService;
	
	private Goodsman goodsman;
	
	private long goodmanno;
	
	private PagerModel pm;
	
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}
	
	public String goAddGoodsman() throws Exception {
		return SUCCESS;
	}
	
	public String addGoodsman() throws Exception {
		goodsmanService.addGoodsman(goodsman);
		return SUCCESS;
	}
	
	public String findAllGoodsman() throws Exception {
		pm = goodsmanService.findGoodsmanForPager();
		return SUCCESS;
	}
	
	public String findGoodsman() throws Exception {
		goodsman = goodsmanService.findGoodsman(goodmanno);
		return SUCCESS;
	}
	
	public String delGoodsman() throws Exception {
		goodsmanService.removeGoodsman(goodmanno);
		return SUCCESS;
	}
	
	public String getGoodsmanForUpdate() throws Exception {
		goodsman = goodsmanService.findGoodsman(goodmanno);
		return SUCCESS;
	}
	
	public String updateGoodsman() throws Exception {
		goodsmanService.updateGoodsman(goodsman);
		return SUCCESS;
	}

	/**
	 * @return the goodmanno
	 */
	public long getGoodmanno() {
		return goodmanno;
	}

	/**
	 * @param goodmanno the goodmanno to set
	 */
	public void setGoodmanno(long goodmanno) {
		this.goodmanno = goodmanno;
	}

	/**
	 * @return the goodsman
	 */
	public Goodsman getGoodsman() {
		return goodsman;
	}

	/**
	 * @param goodsman the goodsman to set
	 */
	public void setGoodsman(Goodsman goodsman) {
		this.goodsman = goodsman;
	}

	/**
	 * @return the goodsmanService
	 */
	public GoodsmanService getGoodsmanService() {
		return goodsmanService;
	}

	/**
	 * @param goodsmanService the goodsmanService to set
	 */
	public void setGoodsmanService(GoodsmanService goodsmanService) {
		this.goodsmanService = goodsmanService;
	}

	/**
	 * @return the pm
	 */
	public PagerModel getPm() {
		return pm;
	}

	/**
	 * @param pm the pm to set
	 */
	public void setPm(PagerModel pm) {
		this.pm = pm;
	}
}
